<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>

  <div id="app">
    <my-cpn></my-cpn>
    <my-cpn></my-cpn>
    <my-cpn></my-cpn> 
  </div>
  <template id="myApp">
    <h2>我是全局组件</h2>
  </template>
  
  <script src="../lib/vue.global.js"></script>
  <script>
    // 1.组件: App组件(根组件)
    const App = {
      data() {
        return {
          message: "Hello Vue"
        }
      }
    }
    // 1.创建app
    const app = Vue.createApp(App)  
    app.component("my-cpn",{
      template:"#myApp",
      data(){
         return {
          note:"111"
         }
      }
    })
    // 2.挂载app
    app.mount("#app")
  </script>
</body>
</html>